
//浏览器localstorage缓存对象
Storage_ = {};
//获取缓存值
Storage_.get = function (name) {
    return JSON.parse(localStorage.getItem(name));
}
//设置缓存值
Storage_.set = function (name, val) {
    localStorage.setItem(name, JSON.stringify(val));
}
//在原有缓存上加数据
Storage_.add = function (name, addVal) {
    var oldVal = Storage_.get(name);
    var newVal = oldVal.concat(addVal);
    Storage_.set(name, newVal);
}
//删除缓存值
Storage_.del = function (name) {
    localStorage.removeItem(name);
}
//清空缓存值
Storage_.clear = function () {
    localStorage.clear();
}


//sessionStorage
session_Storage_ = {};
//获取缓存值
session_Storage_.get = function (name) {
    return JSON.parse(sessionStorage.getItem(name));
}
//设置缓存值
session_Storage_.set = function (name, val) {
    sessionStorage.setItem(name, JSON.stringify(val));
}
//删除缓存值
session_Storage_.del = function (name) {
    sessionStorage.removeItem(name);
}
//清空缓存值
session_Storage_.clear = function () {
    sessionStorage.clear();
}
